/**
 * Author: Lily Jiang
 * Create Time: 2019/12/19
 * Description:
 */

import {request} from './request'

const api = {}

api.demo = () => {
    console.log('api demo')
}



//  登录
api.login = (params) => {
    return request({
        url: '/user/signin',
        type: 'post',
        params: params
    })
}
//  登出
api.logout = () => {
    return request({
        url: '/user/signout'
    })
}
//  获取用户信息
api.getUserInfo = () => {
    return request({
        url: '/user/getuserinfo',
    })
}



//  首页swiper
api.getHomeSwiper = () => {
    return request({
        url: '/article/recommend',
    })
}



//  首页文章列表
api.getArticleList = (params) => {
    return request({
        url: '/article/list',
        params: params
    })
}
//  文章详情
api.articleInfo = (params) => {
    return request({
        url: '/article/detail',
        params: params
    })
}
//  点赞文章
api.articleLike = (params) => {
    return request({
        url: '/article/like',
        params: params,
    })
}




//  文章评论列表
api.articleComments = (params) => {
    return request({
        url: '/article/comments',
        params: params
    })
}
//  评论
api.commentAdd = (params) => {
    return request({
        url: '/comment/add',
        type: 'post',
        params: params
    })
}
//  点赞评论
api.commentLike = (params) => {
    return request({
        url: '/comment/like',
        params: params
    })
}




//  收藏列表
api.collectList = (params) => {
    return request({
        url: '/user/collects',
        params: params
    })
}
//  文章收藏
api.collect = (params) => {
    return request({
        url: '/article/collect',
        params: params,
    })
}




export default api